namespace HBCode.BusinessLogic.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class First : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "Category",
                c => new
                    {
                        CategoryID = c.Long(nullable: false, identity: true),
                        CategoryName = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.CategoryID);
            
            CreateTable(
                "Product",
                c => new
                    {
                        ProductID = c.Long(nullable: false, identity: true),
                        ProductName = c.String(maxLength: 50),
                        Price = c.Decimal(precision: 18, scale: 2),
                        CategoryID = c.Long(),
                    })
                .PrimaryKey(t => t.ProductID)
                .ForeignKey("Category", t => t.CategoryID)
                .Index(t => t.CategoryID);
            
            CreateTable(
                "Customer",
                c => new
                    {
                        CustomerID = c.Long(nullable: false, identity: true),
                        CustomerName = c.String(maxLength: 100),
                        Age = c.Short(),
                        DOB = c.DateTime(),
                        Email = c.String(maxLength: 100),
                        Phone = c.String(maxLength: 20),
                    })
                .PrimaryKey(t => t.CustomerID);
            
        }
        
        public override void Down()
        {
            DropIndex("Product", new[] { "CategoryID" });
            DropForeignKey("Product", "CategoryID", "Category");
            DropTable("Customer");
            DropTable("Product");
            DropTable("Category");
        }
    }
}
